FROM dorowu/ubuntu-desktop-lxde-vnc
ENV DEBIAN_FRONTEND noninteractive

ENV HOME=/root
WORKDIR /root
USER root
RUN echo "root:root" | chpasswd
#RUN useradd yejinlei
#RUN adduser yejinlei sudo
#RUN echo 'yejinlei:yejinlei' | chpasswd

RUN echo 'nameserver 114.114.114.114' >> /etc/resolv.conf && echo 'nameserver 8.8.4.4' >> /etc/resolv.conf && echo '199.232.68.133 raw.githubusercontent.com' >> /etc/hosts
ADD sources.list /etc/apt/sources.list
RUN apt-get update --fix-missing && apt-get dist-upgrade -y

##下载工具
RUN apt-get install -y --fix-missing apt-transport-https wget curl axel git
RUN wget http://mirrors.aliyun.com/ubuntu/pool/main/f/fonts-freefont/fonts-freefont-ttf_20120503-10_all.deb && dpkg -i fonts-freefont-ttf_20120503-10_all.deb

##网络工具
RUN apt-get install -y --fix-missing ca-certificates gnupg build-essential bison htop wireshark iputils-ping net-tools telnet tcpdump nload nethogs iptraf-ng iperf iftop netcat-openbsd iproute2 bridge-utils ethtool nmap ngrep

##音视频工具
RUN apt-get install -y --fix-missing ffmpeg vlc libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio

##shell工具
RUN apt-get install -y --fix-missing tmux neovim openssh-server

##容器工具
RUN apt-get install -y --fix-missing docker.io docker-compose && rm -rf /var/lib/apt/lists/*

##配置sshd
RUN mkdir -p /var/run/sshd && \ 
    echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \
    echo 'AllowAgentForwarding yes' >> /etc/ssh/sshd_config && \   
    echo 'AllowTcpForwarding yes' >> /etc/ssh/sshd_config && \
    echo 'X11Forwarding yes' >> /etc/ssh/sshd_config && \
    echo 'X11DisplayOffset 10' >> /etc/ssh/sshd_config && \  
    echo 'X11UseLocalhost no' >> /etc/ssh/sshd_config && \
    echo 'Port=2222' >> /etc/ssh/sshd_config && \
    echo 'sshd: ALL' >> /etc/hosts.allow

##配置内网穿透
RUN wget https://github.com/fatedier/frp/releases/download/v0.34.0/frp_0.34.0_linux_amd64.tar.gz && tar -zxf frp_0.34.0_linux_amd64.tar.gz && cp frp_0.34.0_linux_amd64/frpc /usr/bin/

##配置浏览器
RUN update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/bin/google-chrome 50

ADD supervisord.conf /etc/supervisor/supervisord.conf 
RUN apt-get clean && sudo apt-get autoclean
ENV PATH="/usr/local/bin:${PATH}"
EXPOSE 80
EXPOSE 2222
EXPOSE 5900
